home *** CD-ROM | disk | FTP | other *** search
/ AMIGA-CD 2 / Amiga-CD - Volume 2.iso / ungepackte_daten / 1994 / 1 / 01 / e-compiler / e-compiler.ampk / E-Compiler / Bin / rexx / Ecomp.rexx next >
Encoding:
OS/2 REXX Batch file  |  1995-06-01  |  1.3 KB  |  72 lines

  1. /*
  2.  * Ecomp.ced
  3.  *
  4.  * $VER: Rick Younie Wed Feb 17 18:40:57 1993
  5.  *
  6.  *    please send comments, questions or improvements:
  7.  *         rick@emma.panam.wimsey.bc.ca   1:153/765.9
  8.  *         rick@emma.tfbbs.wimsey.bc.ca
  9.  *
  10.  * USAGE: save this as REXX:Ecomp.ced and
  11.  *    assign a Cygnus Ed function key to Ecomp
  12.  *
  13.  *
  14.  * SYNOPSIS:
  15.  *    has E compile the program in CED, saving any changes first
  16.  *
  17.  * TODO:
  18.  *
  19.  */
  20.  
  21. /* constants and assigns */
  22.  
  23.    ec    = 'run:ec -we'         /* change this assignment to your own */
  24.  
  25. Main:
  26.    signal on ERROR
  27.  
  28.    address 'rexx_ced'
  29.    options results
  30.  
  31.       /* open a window for dos i/o */
  32.  
  33.    call close 'STDOUT'
  34.    call close 'STDIN'
  35.    call open 'STDIN','CON:130/10/510/100'
  36.    call pragma '*','STDIN'
  37.    call open 'STDOUT','*'
  38.  
  39.       /* find name of file and directory */
  40.  
  41.    'status 19'
  42.    pathfile = result
  43.    say 'filename is' pathfile
  44.  
  45.       /* save file if changed */
  46.  
  47.    'status 18'
  48.   if result ~= 0 then do
  49.       'save' pathfile
  50.       say 'saving changes..'
  51.    end
  52.    else say 'no changes..'
  53.  
  54.       /* compile it */
  55.  
  56.    parse var pathfile pf '.e'
  57.    say 'compiling..'
  58.    address 'COMMAND' ec pf
  59.    say '<ret> to close window'
  60.    pull
  61.    'cedtofront'
  62.    exit 0
  63.  
  64.       /* branches here if RC > 0 from ec */
  65.  
  66. ERROR:
  67.    errline = RC
  68.    'cedtofront'
  69.    'jump to line' errline
  70.    'okay1' 'error in line #'errline
  71.    exit 0
  72.